using System.Collections.ObjectModel;
using System.Linq;

namespace App47
{
    public class MainPageViewModel : BindableBase
    {
        public MainPageViewModel()
        {
            var questions = Enumerable.Range(0, (5 * 6)).Select(i =>
            new Question
            {
                Id = i,
                Text = "The quick brown fox jumps over the lazy dog.",
            });
            for (int i = 0; i < 6; i++)
            {
                var group = new Group
                {
                    Text = string.Format("Group {0}", i),
                    Questions = questions.Skip(i * 5).Take(5).ToArray()
                };
                group.Questions.First().RowSpan = 2;
                group.Questions.First().ColSpan = 2;
                this.Groups.Add(group);
            }
        }

        ObservableCollection<Group> _Groups = new ObservableCollection<Group>();
        public ObservableCollection<Group> Groups { get { return _Groups; } }
    }
}